package java19_5_9.com.huweilong.io.read_file;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

public class ReadFile3 {
    public static void main(String[] args) throws IOException {
        try (InputStream is = new FileInputStream("hello.txt")) {
            byte[] buf = new byte[1024];
            while (true) {
                int n = is.read(buf);
                if (n == -1) {
                    break;
                }
                System.out.println(Arrays.toString(Arrays.copyOf(buf, n)));
            }
        }
    }
}
